1. Field of the Invention
The present invention relates to an image forming apparatus, a method for controlling the same, and a storage medium.
2. Description of the Related Art
Image forming apparatuses that perform processing for dividing a document body by inserting an index sheet on any page designated by a user have been proposed. An index sheet has a shape in which an index portion (tab) is added to a normal rectangular sheet. In general, a set of index sheets is configured by a plurality of index sheets having an index portion located in a different position. In a set of index sheets, a plurality of index sheets having an index portion located in a different position is stacked together such that the positions of the index portions are sequentially displaced from each other. Since the index portion provided in each index sheet is presented out of a normal sheet size, sheets of paper can be divided into chapters. A user who picks up an output matter into which index sheets are inserted is capable of referencing any page based on the position of the index portion of each index sheet.
The image forming apparatus feeds the first index sheet such that the position of the index portion of the leading index sheet to be printed in a print job is in its uppermost position. When the number of index sheets for insertion becomes different from the number of index sheet bundles, the image forming apparatus discharges the remaining index sheets out of the apparatus body upon completion of the print job, and performs a cue of the head of a set of index sheets for the next print job. This process is referred to as a “remaining index sheet discharging process”.
In recent years, multiple types of index sheets have been inserted into any page designated by a user to thereby divide a document body into a document structure having multiple levels such as chapters or clauses. For example, Japanese Patent Laid-Open No. 2006-248672 discloses an image forming apparatus that distinguishes a printed matter using index sheets each having a different color in accordance with the designation of a chapter/clause delimiter by a user.
Japanese Patent Laid-Open No. 2007-283675 discloses an image forming apparatus that detects index data of a document to be printed and analyzes the structure of the document to thereby display the content of indexes in response to the results of analysis. A user of the image forming apparatus designates an index based on the displayed content of indexes.
In the conventional image forming apparatuses disclosed in Japanese Patent Laid-Open No. 2006-248672 and Japanese Patent Laid-Open No. 2007-283675, when index sheets are inserted into a print job having a multi-level document structure, a user needs to explicitly designate which page of the print job corresponds to a chapter/clause delimiter. Thus, when print data having a complex document structure or print data having multiple chapters/clauses is printed, a workload of a user significantly increases, resulting in a reduction in printing efficiency and a cause of operational mistakes.